import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ActivityEffectStatisticsVO, ActivityEffectStatisticsForm, ActivityEffectStatisticsQuery } from '@/api/nursing/activityEffectStatistics/types';

/**
 * 查询活动效果统计列表
 * @param query
 * @returns {*}
 */

export const listActivityEffectStatistics = (query?: ActivityEffectStatisticsQuery): AxiosPromise<ActivityEffectStatisticsVO[]> => {
  return request({
    url: '/nursing/activityEffectStatistics/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询活动效果统计详细
 * @param statId
 */
export const getActivityEffectStatistics = (statId: string | number): AxiosPromise<ActivityEffectStatisticsVO> => {
  return request({
    url: '/nursing/activityEffectStatistics/' + statId,
    method: 'get'
  });
};

/**
 * 新增活动效果统计
 * @param data
 */
export const addActivityEffectStatistics = (data: ActivityEffectStatisticsForm) => {
  return request({
    url: '/nursing/activityEffectStatistics',
    method: 'post',
    data: data
  });
};

/**
 * 修改活动效果统计
 * @param data
 */
export const updateActivityEffectStatistics = (data: ActivityEffectStatisticsForm) => {
  return request({
    url: '/nursing/activityEffectStatistics',
    method: 'put',
    data: data
  });
};

/**
 * 删除活动效果统计
 * @param statId
 */
export const delActivityEffectStatistics = (statId: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/activityEffectStatistics/' + statId,
    method: 'delete'
  });
};
